﻿using Microsoft.Extensions.Options;
using Quartz;

namespace Net7Docker.Jobs
{
    public class MyJobSetup : IConfigureOptions<QuartzOptions>
    {
        public void Configure(QuartzOptions options)
        {
            var jobkey = JobKey.Create(nameof(MyJob));
            options
                .AddJob<MyJob>(jobBuilder => jobBuilder.WithIdentity(jobkey))
                .AddTrigger(trigger =>
                   trigger.ForJob(jobkey).WithCronSchedule("0/5 * * * * ? "));
                          //.WithSimpleSchedule(schedule =>
                          //    schedule.WithIntervalInSeconds(5).RepeatForever()));
        }
    }
}
